package com.weixin.junit;

import java.util.HashMap;
import java.util.List;
import java.util.Map;



import com.weixin.pojo.Token;
import com.weixin.pojo.WeixinGroup;
import com.weixin.util.AdvancedUtil;
import com.weixin.util.CommonUtil;
import org.junit.jupiter.api.Test;

public class token {
	

	@Test
	public void have() {

		/*
		 * Token token=CommonUtil.getToken("wx00e7ccc71e7a1c69",
		 * "d4624c36b6795d1d99dcf0547af5443d"); String
		 * accessToken=token.getAccessToken(); WeixinUserList userlist=
		 * AdvancedUtil.getUserList(accessToken, null); String
		 * openId=userlist.getOpenIdList().get(0); WeixinUserInfo user=
		 * AdvancedUtil.getUserInfo(accessToken, openId);
		 * System.out.println(user.getNickname());
		 * AdvancedUtil.updateMemberGroup(accessToken, openId, 2);
		 */
		 Map<String,String> map =new HashMap<>();
		 map.put("aa", "aa");
		 map.put("aa", "bb");
		 System.out.println(map.get("aa"));
	}


	public void have1() {
		Token token = CommonUtil.getToken("wx2e3e7a7b6e20b4b8",
				"86bca6ba1e260c14ea409c52bc9951cf");
		String accessToken = token.getAccessToken();
		List<WeixinGroup> groups = AdvancedUtil.getGroups(accessToken);
		for (WeixinGroup group : groups) {
			System.out.println(group.getId() + group.getName()
					+ group.getCount());
		}
	}
}
